home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / AIFF_DSP_v15 folder / AIFF_DSP / aiff.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-31  |  2.0 KB  |  65 lines  |  [TEXT/KAHL]

  1. #pragma once
  2. /*
  3. FILE:    aiff.h
  4. PROJECT: Ford grant DSP
  5. AUTHOR:  Ben Denckla
  6. COMMENT: contains macros, external variables, function
  7.          declarations, and data structures relevant to AIFF-based DSP
  8.          programming.
  9.  
  10. C COMPATIBILITY ISSUES:
  11.     "extended" must be an 80 bit IEEE Standard 754 floating point number.
  12.                This is the same as Standard Apple Numeric Environment
  13.                [SANE] data type "Extended".  To achieve this in Think C,
  14.                "8-byte doubles" and "Native floating-point format" must be
  15.                OFF in the Edit:Options...:Compiler Settings dialog
  16.     "short"    must be 16 bits long.
  17.     "long"     must be 32 bits long.
  18.     
  19. */
  20.  
  21. #define DEFFUNC( declaration ) declaration; declaration
  22.  
  23. typedef struct {
  24.     double rate;      // sample rate in frames/sec (96-bit format)
  25.     long   framsiz,   // sample frame size in bytes
  26.            samdatpos; // input file position of sample data
  27. } privateheader;
  28.  
  29. typedef struct { long id, si; } ckhd; // chunk header: id & size
  30.  
  31. typedef struct {
  32.     short    chan;   // number of channels
  33.     long     fram;   // number of sample frames
  34.     short    wdsi;   // sample word size in bits
  35.     extended rate;   // sample rate in frames/sec (80-bit format)
  36. } comckbod;          // common chunk body
  37.  
  38. typedef struct {
  39.     long  offs, bksi; // offset and block size
  40. } sndckbodbeg;        // sound data chunk body beginning
  41.  
  42. typedef struct {
  43.     ckhd        frmhd;   // form chunk header
  44.     long        frm;     // form chunk body beginning (form type)
  45.     ckhd        comhd;   // common chunk header
  46.     comckbod    com;
  47.     ckhd        sndhd;   // sound data chunk header
  48.     sndckbodbeg snd;
  49. } basicaiffbeg;          // basic AIFF beginning
  50. // Note that the basicaiffbeg structure allows storage of Common and 
  51. // Sound Data local chunk types only.
  52.  
  53. extern basicaiffbeg ba;
  54. extern privateheader ph;
  55. extern void *d;
  56.  
  57. void err  ( char *errmsg );
  58. void warn ( char *warnmsg );
  59.  
  60. // programmer-user variables and functions
  61. extern int take_input, make_output;
  62. void process_samdat ( long buflen );
  63. void init_process   ( void );
  64. void term_process   ( void );
  65.